<?php
$tdatastates=array();
	$tdatastates[".NumberOfChars"]=80; 
	$tdatastates[".ShortName"]="states";
	$tdatastates[".OwnerID"]="";
	$tdatastates[".OriginalTable"]="states";


	
//	field labels
$fieldLabelsstates = array();
if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsstates["English"]=array();
	$fieldToolTipsstates["English"]=array();
	$fieldLabelsstates["English"]["id"] = "Id";
	$fieldToolTipsstates["English"]["id"] = "";
	$fieldLabelsstates["English"]["state_code"] = "State Code";
	$fieldToolTipsstates["English"]["state_code"] = "";
	$fieldLabelsstates["English"]["state_name"] = "State Name";
	$fieldToolTipsstates["English"]["state_name"] = "";
	$fieldLabelsstates["English"]["country_id"] = "Country";
	$fieldToolTipsstates["English"]["country_id"] = "";
	if (count($fieldToolTipsstates["English"])){
		$tdatastates[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Hong Kong S.A.R.)")
{
	$fieldLabelsstates["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldToolTipsstates["Chinese (Hong Kong S.A.R.)"]=array();
	$fieldLabelsstates["Chinese (Hong Kong S.A.R.)"]["id"] = "Id";
	$fieldToolTipsstates["Chinese (Hong Kong S.A.R.)"]["id"] = "";
	$fieldLabelsstates["Chinese (Hong Kong S.A.R.)"]["state_code"] = "State Code";
	$fieldToolTipsstates["Chinese (Hong Kong S.A.R.)"]["state_code"] = "";
	$fieldLabelsstates["Chinese (Hong Kong S.A.R.)"]["state_name"] = "State Name";
	$fieldToolTipsstates["Chinese (Hong Kong S.A.R.)"]["state_name"] = "";
	$fieldLabelsstates["Chinese (Hong Kong S.A.R.)"]["country_id"] = "Country Id";
	$fieldToolTipsstates["Chinese (Hong Kong S.A.R.)"]["country_id"] = "";
	if (count($fieldToolTipsstates["Chinese (Hong Kong S.A.R.)"])){
		$tdatastates[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="Chinese (Taiwan)")
{
	$fieldLabelsstates["Chinese (Taiwan)"]=array();
	$fieldToolTipsstates["Chinese (Taiwan)"]=array();
	$fieldLabelsstates["Chinese (Taiwan)"]["id"] = "Id";
	$fieldToolTipsstates["Chinese (Taiwan)"]["id"] = "";
	$fieldLabelsstates["Chinese (Taiwan)"]["state_code"] = "State Code";
	$fieldToolTipsstates["Chinese (Taiwan)"]["state_code"] = "";
	$fieldLabelsstates["Chinese (Taiwan)"]["state_name"] = "State Name";
	$fieldToolTipsstates["Chinese (Taiwan)"]["state_name"] = "";
	$fieldLabelsstates["Chinese (Taiwan)"]["country_id"] = "Country Id";
	$fieldToolTipsstates["Chinese (Taiwan)"]["country_id"] = "";
	if (count($fieldToolTipsstates["Chinese (Taiwan)"])){
		$tdatastates[".isUseToolTips"]=true;
	}
}
if(mlang_getcurrentlang()=="French")
{
	$fieldLabelsstates["French"]=array();
	$fieldToolTipsstates["French"]=array();
	$fieldLabelsstates["French"]["id"] = "Id";
	$fieldToolTipsstates["French"]["id"] = "";
	$fieldLabelsstates["French"]["state_code"] = "State Code";
	$fieldToolTipsstates["French"]["state_code"] = "";
	$fieldLabelsstates["French"]["state_name"] = "State Name";
	$fieldToolTipsstates["French"]["state_name"] = "";
	$fieldLabelsstates["French"]["country_id"] = "Country Id";
	$fieldToolTipsstates["French"]["country_id"] = "";
	if (count($fieldToolTipsstates["French"])){
		$tdatastates[".isUseToolTips"]=true;
	}
}


	
	$tdatastates[".NCSearch"]=true;

	

$tdatastates[".shortTableName"] = "states";
$tdatastates[".nSecOptions"] = 0;
$tdatastates[".recsPerRowList"] = 1;	
$tdatastates[".tableGroupBy"] = "0";
$tdatastates[".mainTableOwnerID"] = "";
$tdatastates[".moveNext"] = 1;




$tdatastates[".showAddInPopup"] = false;

$tdatastates[".showEditInPopup"] = false;

$tdatastates[".showViewInPopup"] = false;


$tdatastates[".fieldsForRegister"] = array();

$tdatastates[".listAjax"] = true;

	$tdatastates[".audit"] = false;

	$tdatastates[".locking"] = false;
	
$tdatastates[".listIcons"] = true;
$tdatastates[".edit"] = true;
$tdatastates[".inlineEdit"] = true;
$tdatastates[".view"] = true;

$tdatastates[".exportTo"] = true;

$tdatastates[".printFriendly"] = true;

$tdatastates[".delete"] = true;

$tdatastates[".showSimpleSearchOptions"] = true;

$tdatastates[".showSearchPanel"] = true;


$tdatastates[".isUseAjaxSuggest"] = true;

$tdatastates[".rowHighlite"] = true;


// button handlers file names

$tdatastates[".addPageEvents"] = false;

$tdatastates[".arrKeyFields"][] = "id";

// use datepicker for search panel
$tdatastates[".isUseCalendarForSearch"] = false;

// use timepicker for search panel
$tdatastates[".isUseTimeForSearch"] = false;

$tdatastates[".isUseiBox"] = false;



$tdatastates[".isUseInlineAdd"] = true;

$tdatastates[".isUseInlineEdit"] = true;
$tdatastates[".isUseInlineJs"] = $tdatastates[".isUseInlineAdd"] || $tdatastates[".isUseInlineEdit"];

$tdatastates[".allSearchFields"] = array();

$tdatastates[".globSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatastates[".allSearchFields"]))
{
	$tdatastates[".allSearchFields"][] = "id";	
}
$tdatastates[".globSearchFields"][] = "state_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_code", $tdatastates[".allSearchFields"]))
{
	$tdatastates[".allSearchFields"][] = "state_code";	
}
$tdatastates[".globSearchFields"][] = "state_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_name", $tdatastates[".allSearchFields"]))
{
	$tdatastates[".allSearchFields"][] = "state_name";	
}
$tdatastates[".globSearchFields"][] = "country_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_id", $tdatastates[".allSearchFields"]))
{
	$tdatastates[".allSearchFields"][] = "country_id";	
}


$tdatastates[".googleLikeFields"][] = "id";
$tdatastates[".googleLikeFields"][] = "state_code";
$tdatastates[".googleLikeFields"][] = "state_name";
$tdatastates[".googleLikeFields"][] = "country_id";



$tdatastates[".advSearchFields"][] = "id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("id", $tdatastates[".allSearchFields"])) 
{
	$tdatastates[".allSearchFields"][] = "id";	
}
$tdatastates[".advSearchFields"][] = "state_code";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_code", $tdatastates[".allSearchFields"])) 
{
	$tdatastates[".allSearchFields"][] = "state_code";	
}
$tdatastates[".advSearchFields"][] = "state_name";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("state_name", $tdatastates[".allSearchFields"])) 
{
	$tdatastates[".allSearchFields"][] = "state_name";	
}
$tdatastates[".advSearchFields"][] = "country_id";
// do in this way, because combine functions array_unique and array_merge returns array with keys like 1,2, 4 etc
if (!in_array("country_id", $tdatastates[".allSearchFields"])) 
{
	$tdatastates[".allSearchFields"][] = "country_id";	
}

$tdatastates[".isTableType"] = "list";


	

$tdatastates[".isDisplayLoading"] = true;

$tdatastates[".isResizeColumns"] = false;





$tdatastates[".pageSize"] = 20;

$gstrOrderBy = "";
if(strlen($gstrOrderBy) && strtolower(substr($gstrOrderBy,0,8))!="order by")
	$gstrOrderBy = "order by ".$gstrOrderBy;
$tdatastates[".strOrderBy"] = $gstrOrderBy;
	
$tdatastates[".orderindexes"] = array();

$tdatastates[".sqlHead"] = "SELECT id,   state_code,   state_name,   country_id";
$tdatastates[".sqlFrom"] = "FROM states";
$tdatastates[".sqlWhereExpr"] = "";
$tdatastates[".sqlTail"] = "";




//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatastates[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdatastates[".arrGroupsPerPage"] = $arrGPP;

	$tableKeys = array();
	$tableKeys[] = "id";
	$tdatastates[".Keys"] = $tableKeys;

//	id
	$fdata = array();
	$fdata["strName"] = "id";
	$fdata["ownerTable"] = "states";
		$fdata["Label"]="Id"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		$fdata["AutoInc"]=true;
	
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "id";
	
		$fdata["FullName"]= "id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 1;
				$fdata["EditParams"]="";
			
		$fdata["bListPage"]=true; 
	
		
		
		
		
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
				$fdata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatastates["id"]=$fdata;
//	state_code
	$fdata = array();
	$fdata["strName"] = "state_code";
	$fdata["ownerTable"] = "states";
		$fdata["Label"]="State Code"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "state_code";
	
		$fdata["FullName"]= "state_code";
	
		
		
		
		
		
				$fdata["Index"]= 2;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=5";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
		
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatastates["state_code"]=$fdata;
//	state_name
	$fdata = array();
	$fdata["strName"] = "state_name";
	$fdata["ownerTable"] = "states";
		$fdata["Label"]="State Name"; 
	
		
		
	$fdata["FieldType"]= 200;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Text field";
	$fdata["ViewFormat"]= "";
	
		
		
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "state_name";
	
		$fdata["FullName"]= "state_name";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 3;
				$fdata["EditParams"]="";
			$fdata["EditParams"].= " maxlength=150";
		
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatastates["state_name"]=$fdata;
//	country_id
	$fdata = array();
	$fdata["strName"] = "country_id";
	$fdata["ownerTable"] = "states";
		$fdata["Label"]="Country"; 
	
		
		
	$fdata["FieldType"]= 3;
	
		
			$fdata["UseiBox"] = false;
	
	$fdata["EditFormat"]= "Lookup wizard";
	$fdata["ViewFormat"]= "";
	
		
		$fdata["LookupType"]=1;
	$fdata["pLookupType"] = 1;
	$fdata["freeInput"] = 0;	
	$fdata["autoCompleteFieldsOnEdit"] = 0;
	$fdata["autoCompleteFields"] = array();
										$fdata["LinkField"]="id";
	$fdata["LinkFieldType"]=3;
	$fdata["DisplayField"]="country_name";
				$fdata["LookupTable"]="countries";
	$fdata["LookupOrderBy"]="country_name";
																$fdata["AllowToAdd"]=true; 
				
					
		
		
		$fdata["NeedEncode"]=true;
	
	$fdata["GoodName"]= "country_id";
	
		$fdata["FullName"]= "country_id";
	
		$fdata["IsRequired"]=true; 
	
		
		
		
		
				$fdata["Index"]= 4;
				
		$fdata["bListPage"]=true; 
	
		$fdata["bAddPage"]=true; 
	
		$fdata["bInlineAdd"]=true; 
	
		$fdata["bEditPage"]=true; 
	
		$fdata["bInlineEdit"]=true; 
	
		$fdata["bViewPage"]=true; 
	
		$fdata["bAdvancedSearch"]=true; 
	
		$fdata["bPrinterPage"]=true; 
	
		$fdata["bExportPage"]=true; 
	
	//Begin validation
	$fdata["validateAs"] = array();
						$fdata["validateAs"]["basicValidate"][] = "IsRequired";
	
		//End validation
	
				$fdata["FieldPermissions"]=true;
	
		
				
		
		
		
			$tdatastates["country_id"]=$fdata;

	
$tables_data["states"]=&$tdatastates;
$field_labels["states"] = &$fieldLabelsstates;
$fieldToolTips["states"] = &$fieldToolTipsstates;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["states"] = array();

	
// tables which are master tables for current table (detail)
$masterTablesData["states"] = array();

// -----------------end  prepare master-details data arrays ------------------------------//

require_once(getabspath("classes/sql.php"));










$proto505=array();
$proto505["m_strHead"] = "SELECT";
$proto505["m_strFieldList"] = "id,   state_code,   state_name,   country_id";
$proto505["m_strFrom"] = "FROM states";
$proto505["m_strWhere"] = "";
$proto505["m_strOrderBy"] = "";
$proto505["m_strTail"] = "";
$proto506=array();
$proto506["m_sql"] = "";
$proto506["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto506["m_column"]=$obj;
$proto506["m_contained"] = array();
$proto506["m_strCase"] = "";
$proto506["m_havingmode"] = "0";
$proto506["m_inBrackets"] = "0";
$proto506["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto506);

$proto505["m_where"] = $obj;
$proto508=array();
$proto508["m_sql"] = "";
$proto508["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto508["m_column"]=$obj;
$proto508["m_contained"] = array();
$proto508["m_strCase"] = "";
$proto508["m_havingmode"] = "0";
$proto508["m_inBrackets"] = "0";
$proto508["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto508);

$proto505["m_having"] = $obj;
$proto505["m_fieldlist"] = array();
						$proto510=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "states"
));

$proto510["m_expr"]=$obj;
$proto510["m_alias"] = "";
$obj = new SQLFieldListItem($proto510);

$proto505["m_fieldlist"][]=$obj;
						$proto512=array();
			$obj = new SQLField(array(
	"m_strName" => "state_code",
	"m_strTable" => "states"
));

$proto512["m_expr"]=$obj;
$proto512["m_alias"] = "";
$obj = new SQLFieldListItem($proto512);

$proto505["m_fieldlist"][]=$obj;
						$proto514=array();
			$obj = new SQLField(array(
	"m_strName" => "state_name",
	"m_strTable" => "states"
));

$proto514["m_expr"]=$obj;
$proto514["m_alias"] = "";
$obj = new SQLFieldListItem($proto514);

$proto505["m_fieldlist"][]=$obj;
						$proto516=array();
			$obj = new SQLField(array(
	"m_strName" => "country_id",
	"m_strTable" => "states"
));

$proto516["m_expr"]=$obj;
$proto516["m_alias"] = "";
$obj = new SQLFieldListItem($proto516);

$proto505["m_fieldlist"][]=$obj;
$proto505["m_fromlist"] = array();
												$proto518=array();
$proto518["m_link"] = "SQLL_MAIN";
			$proto519=array();
$proto519["m_strName"] = "states";
$proto519["m_columns"] = array();
$proto519["m_columns"][] = "id";
$proto519["m_columns"][] = "state_code";
$proto519["m_columns"][] = "state_name";
$proto519["m_columns"][] = "country_id";
$obj = new SQLTable($proto519);

$proto518["m_table"] = $obj;
$proto518["m_alias"] = "";
$proto520=array();
$proto520["m_sql"] = "";
$proto520["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto520["m_column"]=$obj;
$proto520["m_contained"] = array();
$proto520["m_strCase"] = "";
$proto520["m_havingmode"] = "0";
$proto520["m_inBrackets"] = "0";
$proto520["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto520);

$proto518["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto518);

$proto505["m_fromlist"][]=$obj;
$proto505["m_groupby"] = array();
$proto505["m_orderby"] = array();
$obj = new SQLQuery($proto505);

$queryData_states = $obj;
$tdatastates[".sqlquery"] = $queryData_states;

$tableEvents["states"] = new eventsBase;

?>
